<template>
  <el-container style="height: 100%; border: 1px solid #eee">
    <el-aside :width="aside_width" style="height: 100vh; margin-left: -1px">
      <AppAside :isCollapse="isCollapse"></AppAside>
    </el-aside>

    <el-container style="height: 100%">
      <el-header style="text-align: right; font-size: 12px; height: 100%; border-bottom: darkgray 1px solid;">
        <AppHeader @doCollapse="doCollapse"></AppHeader>
      </el-header>

      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
import AppAside from "@/components/AppAside";
import AppHeader from "@/components/AppHeader";

export default {
  name: 'IndexPage',
  components: {
    AppAside,
    AppHeader,
  },
  data(){
      return{
        aside_width:'200px',
        isCollapse:false
      }
  },
  methods:{
    doCollapse(){
      this.isCollapse = !this.isCollapse
      if(!this.isCollapse){//展开
        this.aside_width='200px'
      }else {//收起
        this.aside_width='64px'
      }
    }
  }
};
</script>

<style scoped>
.el-header {
  /*background-color: #B3C0D1;*/
  color: #333;
  line-height: 60px;
}

.el-aside {
  color: #333;
}
</style>
